package test.my.com.myapplicationtest.yuan_xing_tu_view;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;

import java.util.ArrayList;
import java.util.List;

import test.my.com.myapplicationtest.R;

/**
 * Author : Cooper
 * Time : 2016/10/14  11:00
 * Description : 动态圆形图,圆形比例图
 */

public class YuanXingTuActivity extends Activity {

    MagnificentChart magnificentChart;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.aty_yuan_xing_tu_layout);

        MagnificentChartItem firstItem = new  MagnificentChartItem("first", 30, Color.parseColor("#BAF0A2"));
        MagnificentChartItem secondItem = new  MagnificentChartItem("second", 12, Color.parseColor("#2F6994"));
        MagnificentChartItem thirdItem = new  MagnificentChartItem("third", 3, Color.parseColor("#FF6600"));
        MagnificentChartItem fourthItem = new  MagnificentChartItem("fourth", 41, Color.parseColor("#800080"));
        MagnificentChartItem fifthItem = new  MagnificentChartItem("fifth", 14, Color.parseColor("#708090"));

        List<MagnificentChartItem> chartItemsList = new ArrayList<MagnificentChartItem>();
        chartItemsList.add(firstItem);
        chartItemsList.add(secondItem);
        chartItemsList.add(thirdItem);
        chartItemsList.add(fourthItem);
        chartItemsList.add(fifthItem);

        magnificentChart = (MagnificentChart) findViewById(R.id.magnificentChart);

        magnificentChart.setChartItemsList(chartItemsList);
        magnificentChart.setShadowShowingState(false);
        magnificentChart.setAnimationState(true);
        magnificentChart.setMaxValue(100);
    }
}
